Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripting: Added Geometry interface with line and ellipse helpers #3779

Merged
merged 6 commits into from
Aug 1, 2023

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Jul 7, 2023

Providing access from scripts to the existing line and ellipse rendering functions.

Providing access from scripts to the existing line and ellipse rendering
functions.
@eishiya
Copy link
Contributor

eishiya commented Jul 7, 2023

In the comments for ellipseRegion, it would be a good idea to specify whether the parameters represent a bounding rect, or the origin and radius.

@eishiya
Copy link
Contributor

eishiya commented Jul 7, 2023

When using Geometry.ellipseRegion(rect) with a Qt.rect(x,y,0,0), the result is a 2x2 rectangle with x,y at its bottom right corner. I would expect an ellipse with width or height 0 to be either an empty region, or to replace the 0 width and/or height with 1.

This doesn't affect the version that takes numbers, since that takes inclusive points for the rect, and thus cannot make a rectangle with width or height 0.

Now the rectangle is normalized, and when it is empty, the returned
region is also empty.
Since it is about how to handle the QRect when its size is negative, which
is not specific to the scripting API.
@bjorn bjorn merged commit 4a0f569 into mapeditor:master Aug 1, 2023
12 checks passed
@bjorn bjorn deleted the scripting-geometry branch August 1, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants